﻿// <copyright file="ModMatcherEventArgs.cs" company="SingularityShift">
// Copyright (c) 2009 SingularityShift.com
// </copyright>
// <author>Ben McClure</author>
// <email>ben@singularityshift.com</email>
// <date>2009-08-14</date>
// <summary>Arguments including information about a matched mod for an event related to a ModMatcher</summary>
namespace GameLib.Games.Util
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// Describes a ModMatcher and/or its actions for passing via ModMatcher events
    /// </summary>
    public class ModMatcherHandlerEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the ModMatcherEventArgs class.
        /// </summary>
        public ModMatcherHandlerEventArgs()
        {
            this.Handled = false;
        }

        /// <summary>
        /// Initializes a new instance of the ModMatcherEventArgs class, specifying an IModMatcher and a matching mod
        /// </summary>
        /// <param name="matchingMod">The matching mod, if relevent.</param>
        public ModMatcherHandlerEventArgs(IMod matchingMod)
            : this()
        {
            this.MatchingMod = matchingMod;
        }

        /// <summary>
        /// Initializes a new instance of the ModMatcherEventArgs class, specifying an IModMatcher, a matching mod, and an action for handling the match
        /// </summary>
        /// <param name="matchingMod">The matching mod, if relevent.</param>
        /// <param name="action">A ModMatcherHandlerAction specifying how to handle the match</param>
        public ModMatcherHandlerEventArgs(IMod matchingMod, ModMatcherHandlerAction action)
            : this(matchingMod)
        {
            this.Action = action;
        }

        /// <summary>
        /// Gets a reference to the IModMatcher which ran the match
        /// </summary>
        public IModMatcher Matcher
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets a reference to the IMod which matched this IModMatcher
        /// </summary>
        public IMod MatchingMod
        {
            get;
            private set;
        }

        /// <summary>
        /// Gets a reference to the ModMatcherHandlerAction indicating how to handle the match
        /// </summary>
        public ModMatcherHandlerAction Action
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets a value indicating whether this handler should move forward with handling the match
        /// </summary>
        public bool Handle
        {
            get;
            set;
        }

        /// <summary>
        /// Gets a value indicating whether or not action has already been taken
        /// </summary>
        public bool Handled
        {
            get;
            set;
        }
    }
}
